<template>
  <div>
    <a-table :columns="columns" :data-source="data" :rowKey="(record,index)=>{return index}" bordered>
      <template slot="name" slot-scope="text">
        <a href="javascript:;">{{text}}</a>
      </template>
      <template slot="title" slot-scope="currentPageData">
        Header--{{currentPageData}}　　　　
      </template>
      <template slot="footer">
        常用操作&nbsp;: &nbsp;&nbsp;
        <a-button><router-link to="/detail/detail_update_user">修改</router-link></a-button> &emsp;
        <span style="color: red">ps:此时的修改只能修改登录后的用户名</span>
        <router-view></router-view>
      </template>　　// 跟上同理
    </a-table>
  </div>
</template>

<script>
const columns = [
  {
    title: '用户ID',
    dataIndex: 'id',
    key: 'id',
  },
  {
    title: '用户名',
    dataIndex: 'username',
    // key: 'username',
  },
  {
    title: '等级',
    dataIndex: 'user_level',
    // key: 'username',
  },
  // {
  //   title: '密码',
  //   dataIndex: 'password',
  //   // key: 'password',
  // },
];
export default {
name: "detail",
  data() {
    return {
      collapsed: false,
      data:[],
      columns,
    }
  },
  created() {
    this.getUser()
  },
  methods:{
    getUser(){
      this.$axios.get('z/detailuser/')
        .then(res=>{
          this.data=res.data.data
        })
    }
  },
}
</script>

<style scoped>

</style>
